<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib  uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@taglib uri="http://chances.com.cn/jsp/epgdata" prefix="epgdata"%>
<%@taglib uri="http://chances.com.cn/jsp/schedule" prefix="schedule"%>
<%@taglib uri="http://chances.com.cn/jsp/epgutils" prefix="epgutils" %>
<%@page import="java.util.Date"%>

<c:set var="channelCode">${param.channelCode}</c:set>
<c:set var="scheduleDayIdx">${param.scheduleDayIdx}</c:set>
<c:set var="businessCode">${param.businessCode}</c:set>
<c:set var="contextPath">${param.contextPath}</c:set>

<%-- 节目单查询 --%>
<c:set var="today" value="${epgutils:beginEnd(scheduleDayIdx-3,scheduleDayIdx-2)}" />
<schedule:scheduleFilter channelCode="${channelCode}" var="schedules" size="99" startTime="${today.begin.time}"
	endTime="${today.end.time}"/>

<%--频道当天对应的节目单查询 --%>
<div id="scroll_schedule_swiper" class="swiper-container">
		<div id="scroll_schedule"  class="swiper-wrapper" style="
		-webkit-transform: translate3d(0,0,0); -moz-transform: translate3d(0,0,0);
    	-o-transform: translate(0,0,0); -ms-transform: translate3d(0,0,0); transform: translate3d(0,0,0);">
    		<c:forEach items="${schedules}" var="item" varStatus="i">
				<c:set var="imgSrc" value="${contextPath}/sites/weixin/images/live_detail_yuyue.png"/>
				<c:set var="status" value="${schedule:status(item)}"/>
				<c:if test="${status == -1}">
					<c:set var="imgSrc" value="${contextPath}/sites/weixin/images/live_detail_back.png"/>
				</c:if>
				<c:if test="${status == 0}">
					<c:set var="imgSrc" value="${contextPath}/sites/weixin/images/live_detail_play.png"/>
				</c:if>
				
				<fmt:formatDate var="scheduleStartTime" value="${item.startTime}" pattern="HH:mm"/>
				<fmt:formatDate var="startTime" value="${item.startTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
				<fmt:formatDate var="endTime" value="${item.endTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
				
				<c:if test="${status > 0}">
				<%-- <div class="swiper-slide swiper-slide-schedule" style="height: 4em;margin-right: 0em;text-align: left;margin-right: 0em;">
				<div class="row row-schedule" onclick="yuyue('${item.code}','${item.name}','${startTime}','${endTime}')">
					<div class="col-xs-10 showDot" id="content_${i.index}" ><span>${scheduleStartTime}&nbsp;&nbsp;${item.name}</span></div>	
					<div class="col-xs-2 schedule-img" ><img class="yuyueItem col-schedule-image" id="${item.code}" src="${imgSrc}"/></div>
				</div>
				</div> --%>
				<div class="swiper-slide swiper-slide-schedule" style="height: 4em;margin-right: 0em;text-align: left;margin-right: 0em;">
				<div class="row row-schedule">
					<div class="col-xs-10 showDot" id="content_${i.index}" ><span>${scheduleStartTime}&nbsp;&nbsp;${item.name}</span></div>	
					<%-- <div class="col-xs-2 schedule-img" ><img class="yuyueItem col-schedule-image" id="${item.code}" src="${imgSrc}"/></div> --%>
				</div>
				</div>
				</c:if>
				<c:if test="${status <= 0}">
				<div class="swiper-slide swiper-slide-schedule" style="height: 4em;margin-right: 0em;text-align: left;margin-right: 0em;">
					<div class="row row-schedule" onclick="playSchedule('${item.code}','${item.name}','${item.code}')">
						<div class="col-xs-10 showDot" id="${item.code}"><span>${scheduleStartTime}&nbsp;&nbsp;${item.name}</span></div>	
						<div class="col-xs-2 schedule-img" ><img class="col-schedule-image" id="live_detail_${i.index}" src="${imgSrc}"/></div>
					</div>
				</div>
				</c:if>
				<c:if test="${(i.index+1) == fn:length(schedules) }">
					<div class="swiper-slide" style="height: 17.8em; margin-right: 0em;text-align: left;margin-right: 0em;">
					</div>
				</c:if>
			</c:forEach>
		</div>
	</div>
